//
//  SCWishCommentCell.m
//  Mutal
//
//  Created by TonyStart on 16/10/27.
//  Copyright © 2016年 com.wx. All rights reserved.
//

#import "SCWishCommentCell.h"

#import "SDWebImageManager.h"
@interface SCWishCommentCell()
@property (weak, nonatomic) IBOutlet UIImageView *picView;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@end

@implementation SCWishCommentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

-(void)setWishCommentModel:(SCWishCommentModel *)wishCommentModel{
    _wishCommentModel = wishCommentModel;
    if (_wishCommentModel) {
        [self setupContent];
    }
}

-(void)setupContent{
    
    NSString *picUrl = [NSString stringWithFormat:@"http://www.scxxhs.com/huzhu%@",self.wishCommentModel.avatar];
    
    
    
    [[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:picUrl] options:SDWebImageCacheMemoryOnly progress:^(NSInteger receivedSize, NSInteger expectedSize) {
        
    } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {

        if (image) {
            _picView.image = image;
        }else{
            _picView.image = [UIImage imageNamed:@"默认头像"];
        }
    }];
    
    _timeLabel.text = self.wishCommentModel.createtime;
    
    _contentLabel.text = self.wishCommentModel.content;
}



@end
